/// Files: drivers/tty/tty_jobctrl.c drivers/tty/tty_io.c drivers/char/tty_io.c
/// Fix: 54ffccbf053b5b6ca4f6e45094b942fab92a25fc
/// Fixes: 47f86834bbd4193139d61d659bebf9ab9d691e37

virtual detect

@err@
identifier tty, real_tty, pgrp;
position p;
@@

tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, ...)
{
	...
	struct pid *pgrp;
	...
*	\(spin_lock_irq\|spin_lock_irqsave\)(&tty->ctrl_lock, ...);@p
 	put_pid(real_tty->pgrp);
 	real_tty->pgrp = get_pid(pgrp);
*	\(spin_unlock_irq\|spin_unlock_irqrestore\)(&tty->ctrl_lock, ...);
	...
}

@script:python depends on detect@
p << err.p;
@@

coccilib.report.print_report(p[0])
